From: | Dave Clarke |
Date: | 12 Aug 2001 at 07:10:04 |
Subject: | Re: Back to my "ITERATE" problem |
Once upon a time, 11-Aug-01 13:49:28, Andrew Bruno spoke thus about
'[arexx] Back to my "ITERATE" problem':
>I have now got back into the swing of things and am playing with this
>"terminate the loop" thing.
>This is the example program:
>/* */
>ECHO 'Starting the program.'
>test.1 = "ANDREW"
>test.2 = "BARNEY"
>test.3 = "CHARLIE"
>test.4 = "DANNIEL"
>test.5 = "EDWARD"
>test.6 = "FREDERICK"
>name = "EDWARD"
>DO i = 1 to 6
> IF name = test.i THEN
> DO
> ECHO 'Found'
> ITERATE i
> END
> ECHO i
>END
>ECHO 'Exiting program'
If you're trying to terminate the loop when you've found a match then you
should be using LEAVE or BREAK depending on your circumstances.
>So I guess the ITERATE command is not doing what I want.
>I guess the best way to do it is instead of the ITERATE i line, I should put
>in i=6 and it will then stop altogether - right?
ITERATE causes the next iteration of the loop, (ie. simply put, returns
script flow back to the previous DO command).
Dave
ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/